Skip to content

Add reportlab and svglib PDF-generation libraries#64

Merged
jmelahman merged 2 commits into
mainfrom
add-pdf-generation-libs
Jul 9, 2026
Merged

Add reportlab and svglib PDF-generation libraries#64
jmelahman merged 2 commits into
mainfrom
add-pdf-generation-libs

Conversation

@jmelahman

@jmelahman jmelahman commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

What

Adds two PDF-generation libraries to the executor dependency bundle:

Library Version License Footprint
reportlab >=5.0.0 BSD +1 package (Pillow already bundled) — the standard for programmatic PDF generation
svglib >=2.0.2 LGPL-3.0 +4 tiny pure-Python deps (cssselect2, tinycss2, webencodings) — SVG → ReportLab drawings, a clean path from matplotlib SVG output to PDF

Net: +5 pure-Python packages.

Version bump (kept in sync)

The executor and code-interpreter packages are released together, so this bumps all of them 0.4.4 → 0.4.5, matching the release convention from #63:

  • executor/pyproject.toml + executor/uv.lock
  • code-interpreter/pyproject.toml + code-interpreter/uv.lock
  • kubernetes/code-interpreter/Chart.yaml

Why these two

  • reportlab was the explicit ask and is essentially free given Pillow is already present.
  • svglib complements it (and the existing matplotlib stack) by rendering SVG straight into PDFs, with a negligible footprint.

What was deliberately skipped

  • xhtml2pdf (HTML→PDF): resolves to +20 packages, including a PDF-signing/crypto stack (pyHanko, oscrypto, asn1crypto, requests/urllib3), and pins reportlab<5. Fails the "lightweight" goal.
  • weasyprint (HTML/CSS→PDF): requires native system libraries (Pango, cairo, GDK-PixBuf) in the Docker image. Too heavy.
  • borb: dual-licensed AGPL/commercial — avoided on license grounds.

Licensing note

svglib is LGPL-3.0, which matches the existing fpdf2 direct dependency (also LGPL-3.0-only) — so it introduces no new licensing posture. The image only invokes the library (no modification/redistribution of source). No GPL/AGPL anywhere in the dependency tree.

Verification

  • uv lock --check passes for both packages (Docker build uses uv sync --frozen).
  • Smoke-tested in an isolated env: reportlab imports and generates a valid PDF; svglib.svg2rlg imports.

🤖 Generated with Claude Code

jmelahman and others added 2 commits July 9, 2026 11:17
Add two PDF-generation libraries to the executor bundle:

- reportlab (>=5.0.0, BSD): the standard library for programmatic PDF
  generation. Pillow is already bundled, so this adds only 1 package.
- svglib (>=2.0.2, LGPL-3.0): converts SVG into ReportLab drawings,
  giving a clean path from matplotlib SVG output to PDF. Adds 4 small
  pure-Python deps (cssselect2, tinycss2, webencodings + itself).

Skipped xhtml2pdf (HTML->PDF): it pulls ~20 packages including a
PDF-signing/crypto stack (pyHanko, oscrypto, asn1crypto) and pins
reportlab<5, which is at odds with the "lightweight" goal.

svglib's LGPL-3.0 license matches the existing fpdf2 dependency, so it
introduces no new licensing posture. Bump executor 0.4.4 -> 0.4.5.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Keep code-interpreter in sync with the executor version bump: update
code-interpreter/pyproject.toml, its uv.lock, and the Helm chart version
from 0.4.4 to 0.4.5. Matches the release convention from #63.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jmelahman jmelahman merged commit e05ec67 into main Jul 9, 2026
3 checks passed
@jmelahman jmelahman deleted the add-pdf-generation-libs branch July 9, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants